Termin gdx_map[] table, minor reformatting. Windows now works with "garmin
authorrobertl <robertl>
Tue, 16 Sep 2008 02:59:27 +0000 (02:59 +0000)
committerrobertl <robertl>
Tue, 16 Sep 2008 02:59:27 +0000 (02:59 +0000)
mass storage as a garmin protocol" device.

garmin_device_xml.c
jeeps/gpsusbwin.c

index 261422d19fdf5968690d0c2973c49d27b4f7dc7f..981883b2adff66496465b2f6ad1851a902d75984 100644 (file)
@@ -102,6 +102,7 @@ static xg_tag_mapping gdx_map[] = {
   { ext_s, cb_cdata, "/Device/MassStorageMode/DataType/File/Location/FileExtension" },
   { base_s, cb_cdata, "/Device/MassStorageMode/DataType/File/Location/BaseName" },
   { dir_s, cb_cdata, "/Device/MassStorageMode/DataType/File/TransferDirection" },
+  { 0, 0, NULL }
 };
 
 const gdx_info *
@@ -124,7 +125,7 @@ gdx_read(const char *fname) {
 const gdx_info *
 gdx_find_file(char **dirlist) {
   const gdx_info *gdx;
-  while (*dirlist) {
+  while (dirlist && *dirlist) {
     char *tbuf;
     xasprintf(&tbuf, "%s/%s", *dirlist, "/Garmin/GarminDevice.xml");
     mountpoint = *dirlist;
index b0b087c18499735954c1d03fe4c0df21aaf2acab..0b8c73847e9e5d715a8562a910a955cb44f26ea2 100644 (file)
@@ -185,16 +185,15 @@ HANDLE * garmin_usb_start(HDEVINFO* hdevinfo, SP_DEVICE_INTERFACE_DATA *infodata
 }
 
 
-static char ** get_garmin_mountpoints() {
+static char ** get_garmin_mountpoints(void)
+{
 #define BUFSIZE 512
   TCHAR szTemp[MAX_PATH];
   char *p = szTemp;
   char **dlist = xmalloc(0);
   int i = 0;
 
-  fprintf(stderr, "eek!\n");
-  if (GetLogicalDriveStrings(BUFSIZE-1, szTemp)) 
-  {
+  if (GetLogicalDriveStrings(BUFSIZE-1, szTemp)) {
     while(*p) {
       dlist = xrealloc(dlist, sizeof (*dlist ) * ++i);
       //            fprintf(stderr, "Found: %d, %s\n", i, p);